<?php
//print_r($_GET);die;//Array ( [number] => 24 [snums] => 100 [cart_id] => 73 [edit] => 修改 )
include_once("../function.php");

//1判断用户是否登录
if(!isset($_COOKIE['username']))
{
	msg("尚未登录，请登录","./login.php");exit;
}
extract($_GET);//$number
$number=trim($number);
$snums=trim($snums);
$cart_id=trim($cart_id);
if($number>=0&&$snums<=$snums)
{
	$sql="update ts_cart set num='$number' where cart_id='$cart_id'";
	$res=mysqli_query($link,$sql);
	if($res)
	{
		if(mysqli_affected_rows($link)==1)
		{
			header("location:./shopcar.php");exit;
		}		
	}		
}	
else
{
	header("location:./shopcar.php");exit;
}
?>